define(['jquery', 'bootstrap', 'utilback', 'table', 'form', 'myfileinput','zh'], function ($, undefined, Utilback, Table, Form,myfileInput,zh) {

    var Controller = {
    	config: {
    		get_url: '/user/read/detail', // 获取用户详情
    	},
        init: function () {
            this.edit();
            // 初始化表格参数配置
            Table.api.init({
            	singleSelect: true,
                extend: {
                    index_url: './json/runReveal.json', // 查询列表
                    del_url: '/runRevealTem', // 删除
                    edit_url:'runRevealTemEdit.html',
                    multi_url: '/runRevealTem',
                    info_url:'',//信息的页面
                }
            });
            var table = $("#userTable");
            

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                method:'get',
                singleSelect:true,
                showExport:false,
                showToggle: false,
                search:false,
                commonSearch:false,
                searchFormVisible:false,
                showColumns:false,
                columns: [
                    [
                        {field: 'state', checkbox: true, },
                        {field: 'id', title: 'ID'},
                        {field: 'number', title: '序号'},
                        {field: 'data', title: "日期"},
                        {field: 'temLimit', title: "临时限速"},
                        {field: 'orderContent', title: "命令内容"},
                        {field: 'uploadMan', title: "上传人"},
                        {field: 'haveSeenNet',title:'已查看网工区'},
                        {field: 'haveSeenMan', title: "已查看人员"},
                        {field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: function (value, row, index) {
                                return Table.api.formatter.operate.call(this, value, row, index, table);
                            }},
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
            
         
           },
            edit: function () { // 初始化编辑页面
            // myfileInput.init.initSubmit('excelFile');//导入事件绑定
             Form.api.dataTimePicker('.datetimepicker');   
            Form.api.bindevent($("form[role=form]"));
            var id = Util.api.query('id');
            var t = Util.api.query('t');
            if(id && t === 'U') {
                Form.api.fill($('#edit-form'), Controller.config.get_dic, id, function(data) {
                });
            }
        },

        update: function() {
            Form.api.bindevent($("form[role=form]"));
        	Util.api.ajax({
        		type: 'GET',
                url:'',
        	}, function(data) {
        		$('#edit-form').autofill(data);
        	});
        },
    };
    return Controller;
      function changeAgentContent(){
            document.getElementById("inputFileAgent").value
     = document.getElementById("inputFile").value;
    }

});